using Tycho.Parser.Peg;

namespace Tycho.Parser.Tests.Peg {
    class RecoveredProduction : Production {
        private readonly SyntaxErrorRecoveryException SyntaxErrorRecoveryException;

        public RecoveredProduction (SyntaxErrorRecoveryException syntaxErrorRecoveryException) {
            SyntaxErrorRecoveryException = syntaxErrorRecoveryException;
        }

        protected override ParseResult ReallyParse (char[] source, int index, ParseContext context, string sourceString, ParseEnvironment parseEnvironment) {
            throw SyntaxErrorRecoveryException;
        }
    }
}